package com.anysoft.service.impl;

import com.anysoft.model.Goods;
import com.anysoft.model.Goods4JSR303;
import com.anysoft.service.GoodsService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class GoodsServiceImpl implements GoodsService {
    private static ArrayList<Goods> goods = new ArrayList<Goods>();
    private static ArrayList<Goods4JSR303> goods4JSR303s = new ArrayList<Goods4JSR303>();

    @Override
    public boolean save(Goods g) {
        return goods.add(g);
    }

    @Override
    public ArrayList<Goods> getGoods(){
        return goods;
    }

    @Override
    public boolean save(Goods4JSR303 g) {
        return goods4JSR303s.add(g);
    }

    @Override
    public ArrayList<Goods4JSR303> getGoods4jsr303() {
        return goods4JSR303s;
    }
}
